package com.version1_3.model;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by reeves on 2015/12/23.
 */
public class MainPageModel implements JsonSerializable{
    private List pageList;
    private List titleList;
    boolean isLast;

    public List<Map> getPageList() {
        return pageList;
    }

    public void setPageList(List pageList) {
        this.pageList = pageList;
    }

    public List<Map> getTitleList() {
        return titleList;
    }

    public void setTitleList(List titleList) {
        this.titleList = titleList;
    }

    public boolean isLast() {
        return isLast;
    }

    public void setLast(boolean last) {
        isLast = last;
    }

    public MainPageModel(){
        pageList = null;
        titleList = null;
        isLast = false;
    }

    public MainPageModel(List<Map> pageList,List<Map> titleList,boolean isLast){
        this.pageList = pageList;
        this.titleList = titleList;
        this.isLast = isLast;
    }


    @Override
    public String jsonSerialize() {
        Map<String,Object> pageMap = new HashMap<>();
        pageMap.put("result",pageList);
        pageMap.put("title",titleList);
        pageMap.put("isLast",isLast);
        return JSON.toJSONString(pageMap);
    }
}
